package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 店铺设置基本信息
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-23
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_merchant_setting")
@ApiModel(value = "MerchantSetting", description = "店铺设置基本信息")
@AllArgsConstructor
public class MerchantSetting extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "")
    @NotNull(message = "不能为空")
    @TableField("merchant_id")
    @Excel(name = "")
    private Long merchantId;

    /**
     * logo
     */
    @ApiModelProperty(value = "logo")
    @NotEmpty(message = "logo不能为空")
    @Length(max = 255, message = "logo长度不能超过255")
    @TableField(value = "logo_img", condition = LIKE)
    @Excel(name = "logo")
    private String logoImg;

    /**
     * 背景图
     */
    @ApiModelProperty(value = "背景图")
    @NotEmpty(message = "背景图不能为空")
    @Length(max = 255, message = "背景图长度不能超过255")
    @TableField(value = "background_img", condition = LIKE)
    @Excel(name = "背景图")
    private String backgroundImg;

    /**
     * 海报
     */
    @ApiModelProperty(value = "海报")
    @Length(max = 255, message = "海报长度不能超过255")
    @TableField(value = "poster_img", condition = LIKE)
    @Excel(name = "海报")
    private String posterImg;

    /**
     * 主页简介
     */
    @ApiModelProperty(value = "主页简介")
    @Length(max = 65535, message = "主页简介长度不能超过65535")
    @TableField("home_desc")
    @Excel(name = "主页简介")
    private String homeDesc;

    /**
     * 店铺详情
     */
    @ApiModelProperty(value = "店铺详情")
    @Length(max = 65535, message = "店铺详情长度不能超过65535")
    @TableField("shop_detail")
    @Excel(name = "店铺详情")
    private String shopDetail;

    @ApiModelProperty(value = "")
    @TableField("create_date")
    @Excel(name = "", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime createDate;

    @ApiModelProperty(value = "")
    @TableField("update_date")
    @Excel(name = "", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "logo_url", condition = LIKE)
    @Excel(name = "")
    private String logoUrl;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "background_url", condition = LIKE)
    @Excel(name = "")
    private String backgroundUrl;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "poster_url", condition = LIKE)
    @Excel(name = "")
    private String posterUrl;


    @Builder
    public MerchantSetting(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    Long merchantId, String logoImg, String backgroundImg, String posterImg, String homeDesc, 
                    String shopDetail, LocalDateTime createDate, LocalDateTime updateDate, String logoUrl, String backgroundUrl, String posterUrl) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.merchantId = merchantId;
        this.logoImg = logoImg;
        this.backgroundImg = backgroundImg;
        this.posterImg = posterImg;
        this.homeDesc = homeDesc;
        this.shopDetail = shopDetail;
        this.createDate = createDate;
        this.updateDate = updateDate;
        this.logoUrl = logoUrl;
        this.backgroundUrl = backgroundUrl;
        this.posterUrl = posterUrl;
    }

}
